package com.dxq.test.db;

import com.j256.ormlite.field.DatabaseField;
import com.j256.ormlite.table.DatabaseTable;

/**
 * Author: zsh
 * Date: 2023/11/17
 * Describe: 分群表与防治表关联表
 */
@DatabaseTable(tableName = "GroupVaccine")
public class GroupVaccine {

	public final static String GROUP_ID_FIELD_NAME = "group_id";
	public final static String VACCINE_ID_FIELD_NAME = "vaccine_id";

	@DatabaseField(generatedId = true)
	int id;

	// Label
	@DatabaseField(foreign = true, columnName = GROUP_ID_FIELD_NAME)
	Group group;

	// Vaccine
	@DatabaseField(foreign = true, columnName = VACCINE_ID_FIELD_NAME)
	Vaccine vaccine;

	GroupVaccine() {
		// for ormlite
	}

	public GroupVaccine(Group group, Vaccine vaccine) {
		this.group = group;
		this.vaccine = vaccine;
	}

	@Override
	public String toString() {
		return "UserPost{" +
				"id=" + id +
				", group=" + group +
				", vaccine=" + vaccine +
				'}';
	}
}
